<h1>Usuarios</h1>

<%=form_tag users_path, :method=> 'get' do%>
	<%= hidden_field_tag :direction, params[:direction] %>
	<%= hidden_field_tag :sort, params[:sort] %>
	<p>
		<%=text_field_tag :search, params[:search]%>
		<%=submit_tag "Buscar", :name => nil%>
	</p>
<%end%>

<table>
<tr>
  <th><%= sortable "name", "Nombre" %></th>
  <th><%= sortable "username", "Alias" %></th>
  <th><%= sortable "rut" %></th>
</tr>

<% @users.each do |user| %>
  <tr>
    <td><%= user.name %></td>
    <td><%= user.username %></td>
	<td><%= user.rut %></td>
  </tr>
<% end %>
</table>

<%= will_paginate @users %>

<br />
